<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>重复字符串</title>
    <script>
        function show(){
            let word = prompt("请输入重复字符串");
            let count = parseInt(prompt("请输入重复次数"));
            printword(word,count);
        }

        function printword(word,count){
            for (let i = 0; i < count; i++) {
                console.log(i,word)
            }
        }
    </script>
</head>
<body>
    <button onclick="show()">点击</button>
</body>
</html>